<%@codepage="65001"%>
<%session.codepage="65001"%>
<!-- #include virtual=/inc/dbConn.asp -->
<!-- #include virtual=/inc/function.asp -->
<!-- #include virtual=/inc/action.header.inc.asp -->

<%
	'## 파라미터 변수 선언부
	billCd			= Request("billCd")
	toEmail 		= Request("toEmail")
	
	issueDt = aFieldValue("SELECT convert(varchar(8),addDt,112) FROM  tblBizBill WHERE billCd=" & billCd)
		
	'## 거래명세서 정보
	Set bizBillRs=Server.CreateObject("ADODB.RecordSet")
	SQL = "SELECT A.incomeDt, A.income, A.orgAmount, A.tax, A.amount, A.billMemo, A.flag, B.company, B.owner, B.compNo, B.addr  FROM tblIncome A LEFT JOIN tblCompany B ON A.compCd=B.compCd WHERE A.billCd=" & billCd
	bizBillRs.open SQL, dbCon
	
	If bizBillRs.eof Or bizBillRs.bof Then 
	Else 
		Do Until bizBillRs.eof Or bizBillRs.bof
			incomeDt			= bizBillRs("incomeDt")
			income 			= bizBillRs("income")
			billMemo 			= bizBillRs("billMemo")
			orgAmount 		= FormatNumber(bizBillRs("orgAmount"),0)
			tax 					= FormatNumber(bizBillRs("tax"),0)
			amount 			= FormatNumber(bizBillRs("amount"),0)
			flag	 			= bizBillRs("flag")
			clntCompany 	= bizBillRs("company")
			clntOwner	 	= bizBillRs("owner")
			clntCompNo 	= bizBillRs("compNo")
			clntCompAddr 	= bizBillRs("addr")
		bizBillRs.movenext
		Loop 
	End If
	
	subjects = "[노아텍] 거래명세서"
	'context = "<B>마감일 : ffffff</B><BR><BR>자세한 내용은 Intranet에서 확인 바랍니다.<BR><BR><a href=""http://intra.antiochcenter.org"" target=""_blank"">[인트라넷 바로가기]</a>"
	context = ""
	context = "<table width=""500"" cellpadding=""0"" cellspacing=""0"" style=""margin-bottom:10px"">" & _
			"	<tr>" & _
			"		<td  style=""text-align:center;font-size:15pt;font-weight:bold;height:35px;border:2px solid #CCC;"">거래명세서" & _
			"		</td>" & _
			"	</tr>" & _
			"</table>" & _
			"<table width=""500"" cellpadding=""0"" cellspacing=""0"">" & _
			"	<tr>" & _
			"		<td  style=""text-align:left;font-size:12px;padding: 20px 10px 20px 10px;border:1px solid #CCC;line-height:180%;"">" & _
			"		거래명세서가 발급되었습니다. <br> 아래의 링크를 클릭하시면 됩니다. <br>" & _
			" 		<a href=""http://www.noahtech.kr/printBizBill.asp?fullBillCd=" & issueDt & "-" & billCd & """ target=""_blank"">http://www.noahtech.kr/printBizBill.asp?fullBillCd=" & issueDt & "-" & billCd & "</a><br>" & _
			" 		클릭이 안되는 경우는 다음의 링크를 복사하셔서 인터넷 익스프로러의 주소창에 넣어주시기 바랍니다. <br> " & _
			"		http://www.noahtech.kr/printBizBill.asp?fullBillCd=" & issueDt & "-" & billCd & _
			"		</td>" & _
			"	</tr>" & _
			"</table>" & _
			"<table width=""500"" cellpadding=""0"" cellspacing=""0"">" & _
			"	<tr>" & _
			"		<td style=""text-align:right""><img src=""http://www.noahtech.kr/img/logo.jpg"" width=""150"" height=""45"">" & _
			"		</td>" & _
			"	</tr>" & _
			"</table>"
	 
	 
	If toEmail <> "" Then 
		Call GoogleSendMailer(toEmail, "노아텍 발신전용 <hooshim@gmail.com>", subjects, context)
	End If 
		
	Call rsWithXML("Save OK!")
	Response.end
%>